/* GENERAL */

:root {
    --key-size: 3vw;
    --key-size-small: calc(var(--key-size) / 1.4);
    --key-padding: .3vw;
    --key-gap: .5rem;
    --kb-zone-gap: 1rem;
    --font-size: .9vw;
    --font-size-small: .65vw;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: monospace;
    font-weight: bold;
    color: white;
    background-color: dimgray;
    height: 100vh;
    display: grid;
    place-items: center;
}

/* GENERAL BOARD */

#board {
    background-color: #222;
    border-radius: 1rem;
    padding: 1.2rem;
    display: flex;
    width: 80vw;
    user-select: none;
}

.zone {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-right: var(--kb-zone-gap);
}

.zone:last-child {
    margin: 0;
}

.key {
    border: 1px solid #444;
    border-radius: .3rem;
    width: var(--key-size);
    height: var(--key-size);
    padding: var(--key-padding);
    font-size: var(--font-size);
    box-sizing: border-box;
    transition-property: background-color color;
    transition-duration: 50ms;
    overflow: hidden;
}

.key.pressed {
    background-color: lightgray;
    color: black;
}

.key:not(:last-child) {
    margin-right: var(--key-gap);
}

/* ZONE 1 */

.zone:first-child {
    flex: 1;
}

.key[data-key=Backspace],
.key[data-key=Tab],
.key[data-key=Space],
.key[data-key=ShiftLeft],
.key[data-key=ShiftRight],
.key[data-key=Enter],
.key[data-key=CapsLock],
.key[data-key=Backslash] {
    flex: 1;
}

#f-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--kb-zone-gap);
}

#f-row .key {
    height: var(--key-size-small);
    font-size: var(--font-size-small);
}

.f-group {
    display: flex;
}

.main-row {
    display: flex;
    margin-bottom: .5rem;
}

.main-row:last-child {
    margin: 0;
}

/* ZONE 2 */

#func {
    display: flex;
    margin-bottom: var(--kb-zone-gap);
}

#func .key {
    height: var(--key-size-small);
    font-size: var(--font-size-small);
}

#nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

#clipboard,
#arrows {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--key-gap);
}

#clipboard .key,
#arrows .key {
    margin: 0;
}

.key[data-key=ArrowUp] {
    grid-row: 1;
    grid-column: 2;
}

.key[data-key=ArrowDown] {
    grid-row: 2;
    grid-column: 2;
}

.key[data-key=ArrowLeft] {
    grid-row: 2;
    grid-column: 1;
}

.key[data-key=ArrowRight] {
    grid-row: 2;
    grid-column: 3;
}

/* ZONE 3 */

#indicators {
    display: flex;
    align-self: stretch;
    align-items: center;
    flex: 1;
    margin: 0 var(--kb-zone-gap) var(--kb-zone-gap) var(--kb-zone-gap);
}

.indicator {
    max-width: var(--font-size-small);
    height: var(--font-size-small);
    background-color: gray;
    border: 1px solid #333;
    box-shadow: none;
    border-radius: var(--font-size-small);
    flex: 1;
    margin: 0 auto;
    transition-property: background-color;
    transition-duration: 50ms;
    color: black;
    font-size: var(--font-size-small);
    display: grid;
    place-items: center;
}

.indicator.active {
    border: 1px solid transparent;
    background-color: greenyellow;
    box-shadow: 0 0 var(--key-padding) greenyellow;
}

/* NUMPAD */

#numpad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: var(--key-gap);
}

#numpad .key {
    margin: 0;
}

.key[data-key=NumLock] {
    grid-row: 1;
    grid-column: 1;
}

.key[data-key=NumpadDivide] {
    grid-row: 1;
    grid-column: 2;
}

.key[data-key=NumpadMultiply] {
    grid-row: 1;
    grid-column: 3;
}

.key[data-key=NumpadSubtract] {
    grid-row: 1;
    grid-column: 4;
}

.key[data-key=Numpad7] {
    grid-row: 2;
    grid-column: 1;
}

.key[data-key=Numpad8] {
    grid-row: 2;
    grid-column: 2;
}

.key[data-key=Numpad9] {
    grid-row: 2;
    grid-column: 3;
}

.key[data-key=Numpad4] {
    grid-row: 3;
    grid-column: 1;
}

.key[data-key=Numpad5] {
    grid-row: 3;
    grid-column: 2;
}

.key[data-key=Numpad6] {
    grid-row: 3;
    grid-column: 3;
}

.key[data-key=Numpad1] {
    grid-row: 4;
    grid-column: 1;
}

.key[data-key=Numpad2] {
    grid-row: 4;
    grid-column: 2;
}

.key[data-key=Numpad3] {
    grid-row: 4;
    grid-column: 3;
}

.key[data-key=NumpadDecimal] {
    grid-row: 5;
    grid-column: 3;
}

.key[data-key=Numpad0] {
    grid-row: 5;
    grid-column: span 2 / 3;
    width: auto;
}

.key[data-key=NumpadAdd] {
    grid-row: span 2 / 4;
    grid-column: 4;
    height: auto;
}

.key[data-key=NumpadEnter] {
    grid-row: span 2 / 6;
    grid-column: 4;
    height: auto;
    font-size: var(--font-size-small);
}